package com.fjeld.server.ssl.impl;

import com.fjeld.middleware.activemq.HeartbeatPublisher;
import com.fjeld.middleware.activemq.TopicPublisher;
import com.fjeld.server.ssl.ServerStackLayer;
import org.apache.log4j.Logger;

import javax.jms.JMSException;

/**
 * Created by IntelliJ IDEA.
 * User: fjeld
 * Date: 11/12/2011
 * Time: 14:44
 *
 * Publishes a heartbeat.
 */
public class HeartbeatPublisherStack extends AbstractServerStack implements ServerStackLayer
{
    private static final Logger LOGGER = Logger.getLogger(HeartbeatPublisherStack.class);

    private TopicPublisher publisher;
    public HeartbeatPublisherStack() throws JMSException
    {
        LOGGER.info("Initialising");

        // Set up the publisher.
        publisher = new HeartbeatPublisher("PUBLISH.HEARTBEAT."+serverName, serverName + ".HeartbeatPublisherStack");
        publisher.startConnection();
        LOGGER.info("Finished initialising");
    }
}
